package com.itheima.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.itheima.po.FileDetails;
import com.itheima.service.FileDetailsService;


@RestController
public class JsonDataController {
	
	@Autowired
	private FileDetailsService fileDetailsService;
	
	@GetMapping("/show")
	public Map<String,Object> showAll(int page,int limit){
		List<FileDetails> allFile = fileDetailsService.showAllFile();
		Map<String,Object> map = new HashMap<>();
		map.put("data", allFile);//11 10
		map.put("code", 0);
		map.put("count", 11);
		map.put("msg", "跳转");
		System.out.println(map);
		return map;
	}
}
